feat(staged): forward tool call raw_input params through ACP driver to DB#495
feat(staged): forward tool call raw_input params through ACP driver to DB#495
Conversation
Plumb raw_input from ACP ToolCall/ToolCallUpdate through the full
pipeline (LiveAction enum, MessageWriter trait, DB writer) so tool calls
are stored as JSON {"name", "input"} when raw_input is present.
Handle raw_input-only ToolCallUpdate messages that previously were
silently dropped when no title was present, by caching the last-known
title per tool-call row.
Improve formatToolDisplay to extract just the tool name from ACP titles,
show only the primary arg per tool type, and fall through to plain-text
for unrecognized tool names to avoid duplicated content.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
f5b1ab9 to
d625274
Compare
Address code review feedback: add Edit tool to TOOL_VERBS and primaryArg so it shows file_path like other file-based tools, and truncate formatArgs output at 200 chars in the default case to prevent very long detail strings from tools with large inputs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0adf3f2c0d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| } | ||
| None => stored_title.clone(), | ||
| }; | ||
| let content = format_tool_call_content(&effective_title, raw_input); |
There was a problem hiding this comment.
Preserve existing raw_input on title-only tool updates
When a tool call is first stored with raw_input, a later ToolCallUpdate that only changes title reaches this code with raw_input: None, and format_tool_call_content rewrites the DB row as plain text. That silently drops the previously persisted input JSON, so the UI loses structured parameters after a title change. This is a regression in the new raw-input flow and will appear whenever ACP emits title updates without re-sending raw_input.
Useful? React with 👍 / 👎.
| // Unrecognized tool name — fall through to treat parsed.name as plain text | ||
| content = parsed.name; |
There was a problem hiding this comment.
Retain parsed details for unknown JSON tool names
For parsed JSON tool calls whose name is not in TOOL_VERBS, this fallback discards parsed.args and treats the call as plain text. That regresses display for custom/unknown tools (for example MCP tools): instead of showing the tool name and arguments, the UI often degrades to a generic Ran/Running label with missing detail.
Useful? React with 👍 / 👎.
Summary
MessageWritertrait methods (record_tool_call,update_tool_call_title) to accept an optionalraw_inputparameter containing the tool call's input JSONraw_inputfrom ACP session updates through the notification handler to the writer{"name": title, "input": raw_input}when raw_input is present, enabling the frontend to display detailed tool call parametersTest plan
Noneforraw_inputand continue to passraw_inputare stored as JSON in the DBraw_inputfall back to plain title string🤖 Generated with Claude Code